// YL_DEMO_VOIPDlg.h : header file
//
//{{AFX_INCLUDES()
//}}AFX_INCLUDES

#if !defined(AFX_YL_DEMO_VOIPDLG_H__6BEB62E8_EC5D_44D0_803F_9152030CEADB__INCLUDED_)
#define AFX_YL_DEMO_VOIPDLG_H__6BEB62E8_EC5D_44D0_803F_9152030CEADB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CYL_DEMO_VOIPDlg dialog
enum PHONE_STATUS
{
	PHONE_STATUS_READY = 0x1000,
	PHONE_STATUS_DIALING,
	PHONE_STATUS_CONNECTING,
	PHONE_STATUS_CALLFAIL,
	PHONE_STATUS_RINGBACK,
	PHONE_STATUS_CALLIN,
	PHONE_STATUS_CALLMISS,
	PHONE_STATUS_CALLREFUSED,
	PHONE_STATUS_INTALK,
	PHONE_STATUS_ONHOLD,
	PHONE_STATUS_UNHOLD,
	PHONE_STATUS_OUTTALK,
	
	PHONE_STATUS_DRAWTEXT,
	PHONE_STATUS_DRAWBMP,
	PHONE_STATUS_INVERTRECT,
	PHONE_STATUS_DRAWTODEVICE,
	PHONE_STATUS_LEDCTRL,
	PHONE_STATUS_RINGCTRL,
	PHONE_STATUS_TONECTRL,
	PHONE_STATUS_PSTNDIALING,

};

#define WM_YLCALLBACK		WM_USER+2570

class CYL_DEMO_VOIPDlg : public CDialog
{
// Construction
public:
	CYL_DEMO_VOIPDlg(CWnd* pParent = NULL);	// standard constructor
	~CYL_DEMO_VOIPDlg();

// Dialog Data
	//{{AFX_DATA(CYL_DEMO_VOIPDlg)
	enum { IDD = IDD_YL_DEMO_VOIP_DIALOG };
	CEdit	m_Edit;
	CSliderCtrl	m_MicCtrl;
	CSliderCtrl	m_SpkCtrl;
	//}}AFX_DATA
	CDialog *m_pDlg;
	LONG m_lVersion;
	
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CYL_DEMO_VOIPDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	// Generated message map functions
	//{{AFX_MSG(CYL_DEMO_VOIPDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnOpenDevice();
	afx_msg void OnDeviceClose();
	afx_msg void OnConnecting();
	afx_msg void OnRingback();
	afx_msg void OnCallfail();
	afx_msg void OnCallin();
	afx_msg void OnIntalk();
	afx_msg void OnOnhold();
	afx_msg void OnOuttalk();
	afx_msg void OnReleasedcaptureSliderSPK(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnReleasedcaptureSlider2(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnReady();
	afx_msg void OnDialing();
	afx_msg void OnAdvanced();
	afx_msg void OnClose();
	afx_msg void OnClear();
	afx_msg LRESULT OnYlCallBack(WPARAM, LPARAM);
	afx_msg void OnDestroy();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	PHONE_STATUS m_uCurrentStatus;
	BOOL m_bOpened;
	afx_msg void OnBnClickedPstncall();
	afx_msg void OnBnClickedPstndialing();
	afx_msg void OnBnClickedReadeeprom();
	afx_msg void OnBnClickedWriteeeprom();
	CString m_strEeprom;
	LRESULT OnTimer(WPARAM wParam, LPARAM lParam)
	{
		if(wParam == TIMER_CONNECT_DEVICE)
		{
			if (! m_bOpened )
			{
				OnOpenDevice();
			}
		}
		return TRUE;
	}
	enum { TIMER_CONNECT_DEVICE = 0x2000 };

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_YL_DEMO_VOIPDLG_H__6BEB62E8_EC5D_44D0_803F_9152030CEADB__INCLUDED_)
